<!-- <script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'PhotographDemo',
})
</script> -->
<script lang="ts" setup>
function onCameraTake() {
  wx.chooseImage({
    count: 1,
    sizeType: ['original', 'compressed'],
    sourceType: ['album', 'camera'],
    success(res) {
      // tempFilePath可以作为img标签的src属性显示图片
      const tempFilePaths = res.tempFilePaths
      console.log('🚀 -- success -- tempFilePaths', tempFilePaths)
      console.log('🚀 -- success -- res', res)
    },
  })
}
</script>
<template>
  <div>
    <button @click="onCameraTake">拍照</button>
  </div>
</template>

<!-- <style lang="scss"></style> -->
